const IResult = {
    code:'200',
    msg:'',
    data:{}
}

const writeOk = function (resp,msg,data){
    const result = Object.assign({},IResult,{data,code:'200',msg})
    resp.send(result);
 }

const writeFail = function (resp,msg,data){
    const result = Object.assign({},IResult,{data,msg,code:'500'})
    resp.send(result);
}

module.exports = {
    IResult,
    writeOk,
    writeFail
}